package com.example.wechat.model;

import android.os.Parcel;
import android.os.Parcelable;
import java.util.Date;

public class Comment implements Parcelable {
    private String userId;
    private String userName;
    private String content;
    private Date time;

    public Comment() {
    }

    public Comment(String userId, String userName, String content, Date time) {
        this.userId = userId;
        this.userName = userName;
        this.content = content;
        this.time = time;
    }

    protected Comment(Parcel in) {
        userId = in.readString();
        userName = in.readString();
        content = in.readString();
        time = new Date(in.readLong());
    }

    public static final Creator<Comment> CREATOR = new Creator<Comment>() {
        @Override
        public Comment createFromParcel(Parcel in) {
            return new Comment(in);
        }

        @Override
        public Comment[] newArray(int size) {
            return new Comment[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(userId);
        dest.writeString(userName);
        dest.writeString(content);
        dest.writeLong(time.getTime());
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }
} 